<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<p>This tries to select a table inside an editable region whose content is not
editable.  The table and its contents should be selected.</p>
<div id="sample" contenteditable><table id="table" border="1" contenteditable="false"><tr><td>foo</td></tr></table></div>
<div id="log"></div>
<script>
test(function() {
    var selection = window.getSelection();
    var sample = document.getElementById('sample');
    selection.setBaseAndExtent(sample, 0, sample, 1);

    assert_equals(selection.anchorNode, sample, 'anchorNode');
    assert_equals(selection.anchorOffset, 0, 'anchorOffset');
    assert_equals(selection.focusNode, sample, 'focusNode');
    assert_equals(selection.focusOffset, 1, 'focusOffset');
});
</script>
